import request from '@/utils/request'
const moduleApi = '/operation'

/**获取储值活动列表 */
export function getStoredListApi(params) {
  return request({
    url: moduleApi + '/stored',
    method: 'get',
    params
  })
}
/**储值活动详情 */
export function getStoredDetailsApi(activityId) {
  return request({
    url: `${moduleApi}/stored/${activityId}`,
    method: 'get'
  })
}
/**新增储值活动 */
export function postStoredAddApi(data) {
  return request({
    url: moduleApi + '/stored/add',
    method: 'post',
    data
  })
}
/**储值活动失效 */
export function putEditApi({ id, status }) {
  return request({
    url: `${moduleApi}/stored/updateStatus?id=${id}&status=${status}`,
    method: 'put'
  })
}

/**获取储值记录列表 */
export function getRecordListApi(params) {
  return request({
    url: moduleApi + '/opclient/storedBill',
    method: 'get',
    params
  })
}
/**获取储值余额列表 */
export function getAmountListApi(params) {
  return request({
    url: moduleApi + '/opclient/surplusFunding',
    method: 'get',
    params
  })
}
/**余额变动明细 */
export function getAmountChangeListApi(params) {
  return request({
    url: moduleApi + '/opclient/clientBills',
    method: 'get',
    params
  })
}
/**退款 */
export function postRefundApi(data) {
  return request({
    url: `${moduleApi}/opclient/refund`,
    method: 'post',
    data
  })
}
